return group;
}
-/**
- * gtk_init_with_args:
- * @argc: (inout): Address of the `argc` parameter of
- * your main() function (or 0 if @argv is %NULL). This will be changed if
- * any arguments were handled.
- * @argv: (array length=argc) (inout) (allow-none): Address of the
- * `argv` parameter of main(), or %NULL. Any options
- * understood by GTK+ are stripped before return.
- * @parameter_string: (allow-none): a string which is displayed in
- * the first line of `--help` output, after
- * `programname [OPTION...]`
- * @entries: (array zero-terminated=1): a %NULL-terminated array
- * of #GOptionEntrys describing the options of your program
- * @translation_domain: (nullable): a translation domain to use for translating
- * the `--help` output for the options in @entries
- * and the @parameter_string with gettext(), or %NULL
- * @error: a return location for errors
- *
- * This function does the same work as gtk_init_check().
- * Additionally, it allows you to add your own commandline options,
- * and it automatically generates nicely formatted
- * `--help` output. Note that your program will
- * be terminated after writing out the help output.
- *
- * Returns: %TRUE if the windowing system has been successfully
- * initialized, %FALSE otherwise
- *
- * Since: 2.6
- */
-gboolean
-gtk_init_with_args (gint *argc,
- gchar ***argv,
- const gchar *parameter_string,
- const GOptionEntry *entries,
- const gchar *translation_domain,
- GError **error)
-{
- GOptionContext *context;
- GOptionGroup *gtk_group;
- gboolean retval;
-
- if (gtk_initialized)
- goto done;
-
- gettext_initialization ();
-
- if (!check_setugid ())
- return FALSE;
-
- gtk_group = gtk_get_option_group (FALSE);
-
- context = g_option_context_new (parameter_string);
- g_option_context_add_group (context, gtk_group);
- g_option_context_set_translation_domain (context, translation_domain);
-
- if (entries)
- g_option_context_add_main_entries (context, entries, translation_domain);
- retval = g_option_context_parse (context, argc, argv, error);
-
- g_option_context_free (context);
-
- if (!retval)
- return FALSE;
-
-done:
- if (gdk_display_open_default () != NULL)
- {
- if (gtk_get_debug_flags () & GTK_DEBUG_INTERACTIVE)
- gtk_window_set_interactive_debugging (TRUE);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-
/**
* gtk_parse_args:
* @argc: (inout): a pointer to the number of command line arguments